<?php
namespace My\Controller;
use Utuo\BackgroundController;
class AdPositionController extends BackgroundController{
public function _initialize() {
		$this->setControllerTitle("栏目管理");
		$this->setActionTitle(array(
			'index' => '广告位列表',
			'add' => '广告位添加',
			'modify' => '修改广告位',
			'recycle' => '回收站'
		));
		$this->setActionNav(array(
			'index',
			'add',
			'recycle'
		));
	}
	public function getLists($is_deleted){
		$condation=array(
				'cid'=>$this->aid,
				'status'=>1,
				'is_deleted'=>$is_deleted
		);
		$adPosition=M('AdPosition')->where($condation)->select();
		$count=D('AdPosition')->where($condation)->count();
		$this->showPage($count, $this->getPageSize());
	
		$this->assign('adPosition',$adPosition)->display();
	}
	public function addAction(){
		$d = D("ArticleCategory");
		$pid = I("get.id",0,"intval");
		$categoryOptions = $d->getOptionTree(null, $this->aid, 'id,pid,name');
		$adPosition["articleCategoryOptions"]=$this->getOption($categoryOptions, "$pid", '==请选择广告位==');
		$this->assign('adPosition',$adPosition);
		$this->display('save');
	}
}